import React from 'react';
import '../../../static/css/mobile/fenlei_main.less';
import "../../../static/css/mobile/font_zan/iconfont.css";

export default class Fenlei_main extends React.Component{

	constructor(){
		super();
		this.state = {
			N_info : [],
		}
	}

	componentDidMount(){
		this.http();
	}
	http(){
		var result = fetch("http://www.wwtliu.com/sxtstu/news/juhenews.php?type=junshi&count=30",{
			method:"get"
		})
		.then(res => {
			return res.json();
		})
		.then(json => {
			this.setState({
				N_info:json
			})
		})
	}

	render(){
		var  { N_info } = this.state;
		
		return(
           <div className="fenlei_main_div">
             <ul>
                {
                	N_info.map((a,b) =>{
                       return (
                         <li>
                            <a href={a.url}>
                               <span>{a.author_name} <small>{a.date}</small><i className="iconfont icon-zan"><sup>+{Math.ceil(Math.random()*100)+100} </sup></i>
                               </span>
                               
                            </a>
                         </li>
                       	)
                	})
                }
             </ul>
           </div>
			)
	}
}